cecho('/VOTEMAN REMINDER - Start reminder to remind people to vote')
exit
end
signal value command
exit
install:
/**/
if ~exists('Rexx/CTCP/Vote.amirx')|~exists('Rexx/Pub/Vote.aMIRX')|~exists('Rexx/Voteman.amirx') then do
cecho('Missing scripts!')
exit
end
if find(getclip('sc_extrctcp'),'VOTE')~=0|find(upper(getclip('sc_extrscr')),'VOTE.AMIRX')~=0|find(getclip('sc_pubcmd'),'VOTE')~=0|find(upper(getclip('sc_pubscr')),'VOTE.AMIRX')~=0 then do
if ~exists('Rexx/CTCP/Vote.amirx')|~exists('Rexx/Pub/Vote.aMIRX')|find(getclip('sc_extrctcp'),'VOTE')=0|find(upper(getclip('sc_extrscr')),'VOTE.AMIRX')=0|find(getclip('sc_pubcmd'),'VOTE')=0|find(upper(getclip('sc_pubscr')),'VOTE.AMIRX')=0 then do
cecho('Error : Incorrect installation')
cecho('1. You must have the file Rexx/CTCP/Vote.amirx CTCP plugin')
cecho('2. You must have the file Rexx/Pub/Vote.amirx Command plugin')
cecho('3. You must add the CTCP Plugin via the K¹¹ GUI as command VOTE script vote.amirx')
cecho('4. You must add the Command Plugin via the K¹¹ GUI as command VOTE script vote.amirx')
exit
end
channels=getclip('sc_autochannels')
if channels~='ALL' then do
"GETCHANNEL"
channel=upper(result)
if find(channels,channel)=0 then do
call setclip('sc_autochannels',channels channel)
cecho('Adding this channel as AutoChannel')
end
end
if ~open(1,'Kuang11/Vote','R') then do
cecho('Vote File Kuang11/Vote does not exists.')
exit
end
i=-1
do until eof(1)
line=strip(readln(1))
if left(line,1)='#'|line='' then iterate
if i=-1 then topic=line
else option.i=line
i=i+1
end
close(1)
options=i-1
call clear
call Setclip('st_vt_topic',topic)
do i=0 to options
call setclip('st_vt_desc'i,option.i)
end
call setclip('st_vt_opts',options)
"GETUSERS"
users=compress(result,'+@')
call setclip('st_vt_users',users)
out und('K¹¹ Vote on' bld(topic) "Starting :")
do i=0 to options
out i"." option.i
END
call instruct
exit
/**/
reminder:
/**/
options=getclip('st_vt_opts')
if options='' then do
cecho('No vote started')
exit
end
cecho('Vote Notifier starting' retries 'retries every ~'time 'minutes.')
time=time*50*60;spent=0
signal on halt
do retries
call delay(max(0,time-spent*freq))
timer=time('S')
users=getclip('st_vt_users')
if users='' then do
cecho('All users voted!Vote reminder exiting.')
exit
end
nusers=''
do until users=''
parse var users nick users
if find(getclip('st_vt_users'),nick)=0 then iterate
"USERHOST" nick
host=result
if pos('@',host)=0 then iterate
parse var host . '@' host
if find(getclip('st_vt_voters'),host)~=0 then iterate
nusers=nusers nick
'QueueRAW NOTICE' nick ':Please Vote!'
/*call delay(2*freq)*/
end
nusers=strip(nusers)
call setclip('st_vt_users',nusers)
if nusers='' then do
cecho('All users notified.Exiting.')
exit
end
cecho('Reminded to vote :' words(nusers) ':' nusers)